<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<link rel="stylesheet" media="screen" type="text/css" href="__THEMES__/style/layout.css" />
		<script type="text/javascript" src="__JS__/jQuery/jquery.js"></script>
		<script type="text/javascript" src="__JS__/jQuery/plugin/troperate.js"></script>
		<script type="text/javascript">
            $(function(){
                $('.displayImg').click(function(){
					if($('.tr_'+$(this).attr('rel')).is(":visible") == false ){
						$('.tr_'+$(this).attr('rel')).show();
						$(this).attr('src','__THEMES__/images/hidden.gif');
						$(this).removeClass('displayImg');
						$(this).addClass('hiddenImg');
					}else{
						$('.tr_'+$(this).attr('rel')).hide();
						$(this).attr('src','__THEMES__/images/display.gif');
						$(this).removeClass('hiddenImg');
						$(this).addClass('displayImg');
					}
				});
				//ajax排序
				$('.esort').dblclick(function(){
					var id = $(this).attr('rel');
					var ovalue = $(this).text();
					$(this).html('<input type="text" name="sort_one" id="edit_'+id+'" class="input_text" style="width:24px;" value="'+ovalue+'" />');
					$('#edit_'+id).focus().live('blur',function(){
						var value = $(this).val();
						if ( !/^\d+$/.test(value) ){
							alert('排序必须为正整数！');
							return false;
						}else{
							$(this).parent().html(value);
							if ( ovalue != value ){
								$.post('{:U("updateOneSort")}',{id:id,sort:value});
							}
						}
					});
				});
            });
        </script>
	</head>
	<body>
		
		<include file="Public:position" />
		
		<div class="button">
    		<input type="button" value="添加一级分类" class="submit" id="add_category" onclick="window.location.href='{:U('add',array('tag'=>$_GET['tag']))}';"  />
    	</div>
        
        <div class="a_table">
        <!--form action="__URL__/otheraction" method="post"-->
		<table width="100%">
			<tr style="background: #f0f7ff; font-weight: bold;">
				<td width="30" align="center" class="left_text">排序</td>
				<td width="60" align="center" class="left_text">编号</td>
				<td width="20" class="left_text"></td>
				<td align="center" class="left_text">分类名称</td>
				<td align="center" class="left_text">上级分类</td>
				<td width="150" align="center" class="left_text">状态</td>
				<td align="center" class="left_text">类型</td>
				<td width="210" align="center" class="left_text">操作</td>
			</tr>
			{$list}
		</table>
		<br />
		<!--input type="submit" name="update_sort" class="submit" id="update_sort" value="更新排序" />
		</form-->
        </div>
	</body>
</html>